import java.util.Comparator;

class Person{
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class AgeCompare implements Comparator<Person>{
    @Override
    public int compare(Person o1, Person o2) {
        return o1.age-o2.age;
    }
}
class NameCompare implements Comparator<Person>{
    @Override
    public int compare(Person o1, Person o2) {
        return o1.name.compareTo(o2.name);
    }
}

public class Test2 {
    public static void main(String[] args) {
        Person person1=new Person("zhangsan",14);
        Person person2=new Person("lisi",20);
        System.out.println(person1.age-person2.age);
        System.out.println(person1.name.compareTo(person2.name));

        //System.out.println(14^3);

    }

}
